import http from '@/utils/request'

export async function getRoles(params) {
  return await http.get("/api/role/list", params)
}

export async function addRole(data) {
  return await http.post("/api/role/add", data)
}

export async function updateRole(data) {
  return await http.put("/api/role/update", data)
}

export async function checkRole(params) {
  return await http.getRestApi("/api/role/check", params)
}

export async function deleteRole(params) {
  return await http.delete("/api/role/delete", params)
}

export async function getAssignTree(params) {
  return await http.get("/api/role/getAssignPermissionTree", params)
}

export async function assignSave(params) {
  return await http.post("/api/role/saveRoleAssign", params)
}